package com.peng.my_blog.chat.controller;

import com.peng.my_blog.chat.entity.Msg;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

/**
 * @author wangshipeng
 * @Description:
 * @date 2019-03-08 11:17
 */
@Controller
@RequestMapping("/chat")
public class ChatController {

//    @Autowired
//    private UserService userService;



    @RequestMapping("/index")
    public String chatShowPage(Model model, HttpSession session, Msg msg) {
        System.out.println(msg);
//        User userInfoById = userService.getUserInfoById(20);
//        System.out.println(userInfoById);

//        User user_info = (User)session.getAttribute("user_info");
//        Map<String,String> map = new HashMap<>();
//        map.put("name","xiaoming");
//        map.put("age","18");
//        session.setAttribute("user",map);
        //获取当前聊天列表
//        List<ChatInfoVo> charInfoList = chatService.getChatInfoListByUserId(user_info.getId());
//        model.addAttribute("charInfoList",charInfoList);
//        model.addAttribute("user",user_info);

        return "chat/index";
    }
}
